package com.nulldev.util.net.dsap.packets;

import com.nulldev.util.net.dsap.Server;
import com.nulldev.util.net.packets.APILevel;
import com.nulldev.util.net.packets.NetInfo;
import com.nulldev.util.net.packets.UniversalPacket;

@APILevel(level = 4)
public class DSAPClose extends UniversalPacket {

	public DSAPClose() {
		super("Dynamic Socket Allocation Protocol: Close Allocated Socket", "dsap.socket.close");
	}

	@Override
	@Deprecated
	public void client(byte[] data, byte[] raw, NetInfo client) {
	}

	@Override
	public void server(byte[] data, byte[] raw, NetInfo connection) {
		if (connection.get() instanceof Server) {
			((Server)connection.get()).closeDSAP();
		}
	}

}
